<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录界面</title>
</head>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/locale/easyui-lang-zh_CN.js"></script>
<script>
	$(function(){
		$("#login").click(function(){
			var password=$("#password").val();
			var userName=$("#userName").val();
			$.ajax({
				url:'login',
				type:'post',
				data:{userName:userName,password:password},
				success:function(data){
					if(data.status<1){
						alert(data.msg);
					}else{
						window.location.href='index';
						alert("登录成功");
					}
				},
				error:function(xx,error){
					
				}
			});
		});
	});
</script>
<body>
	用户名<input type="text" id="userName"><br>
	密码<input type="password" id="password"><br>
	<input type="button" id="login" value="登录"><br>
</body>
</html>